{include file="public/header"/}
<script src="{__PUBLIC_PATH}/common/js/admin_jquery-ui.min.js?t={php}echo time();{/php}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/ueditor.config.js?t={php}echo time();{/php}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/ueditor.all.min.js?t={php}echo time();{/php}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/Ueditor/lang/zh-cn/zh-cn.js?t={php}echo time();{/php}"></script>
<!--<script src="{__PUBLIC_PATH}/common/plugins/wxeditor/ueditor/ueditor.all.js?t={php}echo time();{/php}"></script>
<script src="{__PUBLIC_PATH}/common/plugins/wxeditor/wxeditor.js?t={php}echo time();{/php}"></script>-->
</head>
<body>
<style type="text/css" media="screen">
.head-oper{padding:15px;line-height:24px;min-height:24px;border-bottom:1px solid #f6f6f6;margin-bottom:10px;overflow:hidden;}
</style>
<form class="layui-form" id="pcfcms-form" onsubmit="return false;">
<div class="layui-fluid pd83" id="LAY-component-layer-list">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form-item layui-row">
                <div class="head-oper">
                    {notempty name='$gourl'}
                    <div class="fl">
                    <a href="{$gourl}" class="layui-btn layui-btn-primary input-btn-back">
                    <i class="layui-icon layui-icon-left"></i></a>
                    </div>
                    {/notempty}  
                    <div class="fl" style="line-height:38px;min-height:38px;margin-left:1%;">
                    {$info.typename} - 内容管理</div>  
                </div>
                {include file="field/addonextitem"/}
                <input type="hidden" name="gourl" value="{$gourl}">
                <input type="hidden" name="typeid" id="typeid" value="{$info.id}">
            </div>
        </div>
    </div>
</div>    
<div class="submit-info text-center">
    <button class="layui-btn" lay-submit lay-filter="formSubmit">确认提交</button>
    <a class="layui-btn layui-btn-primary" href="{$gourl}">返回</a>
</div>
</form>
{include file="public/footer"/}
<script>
    layui.use(['layer', 'form','element'], function () {
        var $ = layui.$,
            element = layui.element,
            layer = layui.layer,
            form = layui.form;

        //监听提交
        form.on('submit(formSubmit)', function(data){
            ueditorHandle();
            var pcfdata = $("#pcfcms-form").serialize();
            layer.msg('正在处理请勿刷新页面', {icon: 16,shade: 0.01,time:3600000});
            $.ajax({
                type : 'post',
                url : "{:url('/arctype/single_edit')}",
                data : pcfdata,
                dataType : 'json',
                success : function(res){
                    layer.closeAll('loading');
                    if(res.status){
                        layer.msg(res.msg, {icon: 1, time: 1000}, function(){
                            window.location.href = res.url;
                        });
                    }else{
                        layer.msg(res.msg, {icon: 2, time: 1000});
                    }
                },
                error: function(e){
                    layer.closeAll('loading');
                    layer.msg("未知错误，操作中断！", {icon: 2, time: 1000});
                }
            });
        })

    });
</script>